package comman.duke 
{
	import flash.utils.*;
	/**
	 * ...
	 * @author jerry.d
	 */
	public class PoolMgr 
	{
		private static var pools:Object = {};
		public function PoolMgr() 
		{
			
		}
		
		public static function gain(clas:Class):*{
			var classKey:String = getQualifiedClassName(clas);
			var pool:Pool = pools[classKey] || (pools[classKey] = new Pool(clas));
			return pool.gain();
		}
		
		public static function reclaim(obj:*):void{
			var classKey:String = getQualifiedClassName(obj);
			var pool:Pool = pools[classKey];
			if ( pool ){
				pool.reclaim(obj);
			}else{
				trace(classKey+":wrong use of Pool");
			}
		}
	}

}